<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 队列
    let promise = Promise.resolve('p');
    promise.then(v => {
      // console.log(v)
      return new Promise(resolve => {
        setTimeout(() => {
          console.log(1)
          resolve(v)
        }, 1000)
      })
    }).then(v => {
      // console.log('ab')
      return new Promise(resolve => {
        setTimeout(() => {
          console.log(2)
          resolve(v)
        }, 1000)
      })
    })
  </script>
</body>
</html>